package com.designpatternspart2.structuraldesignpatterns.compositepattern;

/**
 *
 * @author Lance
 */
public class Leaf implements Component
{

    private String name;

    public Leaf(String name)
    {
        this.name = name;
    }

    @Override
    public void sayHello()
    {
        System.out.println(getName() + " leaf says hello");
    }

    @Override
    public void sayGoodbye()
    {
        System.out.println(getName() + " leaf says goodbye");
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }
}
